home *** CD-ROM | disk | FTP | other *** search
Makefile | 1992-06-20 | 5.9 KB | 212 lines |
- # NOTES: (rosenkra@convex.com)
- # - used GNU C v1.40, MiNT libs PL 19, GNU make 3.60, bison v1.14,
- # flex v2.3.7.
- # - "bison -y -d" produces y_tab.c and y_tab.h on atari. these were
- # changed here as was the #include "y.tab.h" in scan.l.
- # - "flex" produces lexyy.c on atari (not lex.yy.c). changed here.
- # - changed PREFIX, INCLUDE, YACC, LEX, MAKE macros
- # - changed targets to make .ttp files
- # - changed CC macro; added LD macro and used in .ttp targets
- # - added CP macro and replaced all cp's with $(CP) (if your cp does
- # not grok -p, change CP)
- # - removed -D_POSIX_SOURCE from CFLAGS (not used anywhere anyway)
- # - added LIBS macro and added to rules for targets
- # - changed all *.dist files to ./dist/* instead (ie in directory)
- #-----------------------------------------------------------------------------
- # A makefile for bc. This is part of the bc/sbc distribution.
- #
- #
- # Make sure these have the correct directories for your machine.
- #
- # LIBDIR and BINDIR are where bc and libmath.b will be put.
- #
- PREFIX = e:/local
- LIBDIR = $(PREFIX)/lib
- BINDIR = $(PREFIX)/bin
- MANDIR = $(PREFIX)/man/man1
- #
- # INCLUDE is the directory from where header files are included.
- #
- INCLUDE = g:/mint/include
- #
- # This is the name of the library file, if needed. This definition should
- # not be deleted.
- #
- LIBFILE = $(LIBDIR)/libmath.b
- #
- # Programs definitions for use by make.
- #
- SHELL = sh
- YACC = bison -y
- # i need the -S to force skeleton for flex. -I8 is original flag...
- LEX = flex -Sg:/gnu/gcc/flex.ske -I8
- CC = gcc -v -z -Wall -Ig:/mint/include
- LD = gcc -v -z -Wall -Lg:/mint/lib
- UUENCODE = uue
- MAKE = make360
- # this is GNU cp from futils. -p preserves timestamp
- CP = cp -p
- #
- # The following are the standard definitions. For MINIX PC, you need to
- # comment these out and select one of the MINIX PC definition sets.
- # Other configuration defines are generated automatically. See the
- # README file for more details.
- #
- O=o
- #CFLAGS = -O -D_POSIX_SOURCE
- CFLAGS = -O
- LDFLAGS = -nostdlib g:/mint/lib/crt0.o
- #
- # For the PC version of MINIX (K&R compiler), use the following lines.
- #
- #O=s
- #CFLAGS = -O -D_POSIX_SOURCE
- #LDFLAGS = -i
- #
- # For the PC version of MINIX (ANSI compiler), use the following lines:
- #
- #O=o
- #CFLAGS = -m -D_POSIX_SOURCE
- #LDFLAGS = -i
- #
- # -nostdlib requires this (no -lflexlib was needed):
- LIBS = -lgnu
- #
- OFILES = scan.$O util.$O main.$O number.$O storage.$O load.$O execute.$O
- #
- DISTFILES = COPYING Makefile Install bc.y bcdefs.h const.h version.h \
- execute.c global.c global.h load.c main.c number.c storage.c \
- number.h proto.h scan.l util.c vfprintf.c README bc.1 sbc.y \
- fix_math.h math.h libmath.b configure ChangeLog
- #
- SUBDIRS = examples test
- #
- EXTRAFILES = ./dist/bc.c ./dist/scan.c ./dist/y_tab.h
- #
-
-
- all: bc.ttp
-
- bc.ttp: $& config.h bc.$O $(OFILES) global.$O
- $(LD) -o bc.ttp $(LDFLAGS) bc.$O $(OFILES) global.$O $(LIBS)
-
- sbc.ttp: sbc.$O $(OFILES) global.$O
- $(LD) -o sbc.ttp $(LDFLAGS) sbc.$O $(OFILES) global.$O $(LIBS)
-
- config.h:
- ./configure $(INCLUDE) $(LIBFILE) $(CC)
-
- math.h: libmath.b
- $(MAKE) fbc.ttp
- ./fbc -c libmath.b <u:/dev/null >math.h
- ./fix_math.h
- rm -f ./fbc
-
- # this really needs to be built manually with on my system
- fbc.ttp: $(OFILES) bc.$O
- echo \"\" > math.h
- $(CC) -c $(CFLAGS) global.c
- $(LD) -o fbc.ttp $(LDFLAGS) bc.$O $(OFILES) global.$O $(LIBS)
-
- install : bc.ttp libmath.b config.h
- rm -f $(BINDIR)/bc.ttp
- $(CP) bc.ttp $(BINDIR)
- chmod 555 $(BINDIR)/bc.ttp
- if grep -s BC_MATH_FILE config.h; then rm -f $(LIBDIR)/libmath.b; \
- $(CP) libmath.b $(LIBDIR); chmod 444 $(LIBDIR)/libmath.b; else true; fi
- $(CP) bc.1 $(MANDIR)
-
- dist: $(EXTRAFILES)
- OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
- ; rm -rf $$OF \
- ; mkdir $$OF \
- ; cd $$OF \
- ; for file in $(DISTFILES) $(EXTRAFILES); do ln ../$$file; done \
- ; mkdir $(SUBDIRS) \
- ; for dir in $(SUBDIRS); do $(CP) ../$$dir/* $$dir; done \
- ; cd .. \
- ; tar cf $$OF.tar $$OF \
- ; compress $$OF.tar \
- ; rm -rf $$OF
-
- shars: dist
- OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
- ; $(UUENCODE) $$OF.tar.Z - > $$OF.uue \
- ; split -775 $$OF.uue $$OF-u. \
- ; for file in $$OF-u.a?; do shar $$file > $$file.sh; done
-
- minixdist: $(EXTRAFILES)
- OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
- ; rm -rf $$OF \
- ; mkdir $$OF \
- ; cd $$OF \
- ; for file in $(DISTFILES) $(EXTRAFILES); do ln ../$$file; done \
- ; cd .. \
- ; tar cf $$OF.tar $$OF \
- ; compress -b13 $$OF.tar \
- ; rm -rf $$OF
-
- minixshars: minixdist
- OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
- ; $(UUENCODE) $$OF.tar.Z - > $$OF.uue \
- ; split -775 $$OF.uue $$OF-u. \
- ; for file in $$OF-u.a?; do shar $$file > $$file.sh; done
-
- csrshars: $(EXTRAFILES)
- findsrc -dy $(DISTFILES) $(EXTRAFILES) $(SUBDIRS) | \
- makekit -npart -oMANIFEST
-
- ./dist/bc.c: bc.c
- $(CP) bc.c ./dist/bc.c
-
- ./dist/scan.c: scan.c
- $(CP) scan.c ./dist/scan.c
-
- ./dist/y_tab.h: y_tab.h
- $(CP) y_tab.h ./dist/y_tab.h
-
- extra: $(EXTRAFILES)
-
- # assumes that the extra files exist!
- derived:
- $(CP) ./dist/bc.c bc.c
- $(CP) ./dist/scan.c scan.c
- $(CP) ./dist/y_tab.h y_tab.h
-
- clean:
- rm -f *.$O core ERRS *~ *.bak *.Z
-
- distclean: clean
- rm -f scan.c y_tab.h bc.c sbc.c bc sbc bc-dist* config.h bc-*.* \
- part?? MANIFEST*
-
- realclean: distclean
- rm -rf *.dist
-
- scan.c: scan.l
- $(LEX) scan.l
- mv lexyy.c scan.c
-
- y_tab.h bc.c: bc.y
- @echo "expect 1 shift/reduce conflict"
- $(YACC) -d bc.y
- mv y_tab.c bc.c
-
- sbc.c: sbc.y
- $(YACC) -d sbc.y
- mv y_tab.c sbc.c
-
- global.$O: bcdefs.h global.h math.h
- bc.$O: bcdefs.h global.h
- execute.$O: bcdefs.h global.h
- load.$O: bcdefs.h global.h
- main.$O: bcdefs.h global.h version.h
- number.$O: bcdefs.h Makefile
- sbc.$O: bcdefs.h global.h
- scan.$O: y_tab.h bcdefs.h global.h
- storage.$O: bcdefs.h global.h
- util.$O: bcdefs.h global.h version.h
-
- bcdefs.h: number.h const.h config.h
- touch bcdefs.h
-